Fix: some easy-to-fix problems in [Code scan] issues#7582
Conversation
Line 9 contained the invalid expression `fdir suffix + s_dir`, which made projection.py unparseable. Use `fdir + s_dir` to match the working example copy. Closes deepmodeling#7541 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
`bash -n` failed on the empty `else` branch before `fi`. Add a `:` no-op so the example script is syntactically valid. Closes deepmodeling#7542 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
index_map_ is allocated with final dimension length bra.lmax()+ket.lmax()+1, so valid indices are 0..dim_size(6)-1. The bounds check used `l <= dim_size(6)`, allowing a one-past read. Use `l < dim_size(6)` to match the neighboring dimension checks. Closes deepmodeling#7552 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Each 3D row is placed at offset_out advancing by size[2], so the contiguous copy length must also be size[2]. The copy used size[1], corrupting non-cubic slices where size[1] != size[2]. Closes deepmodeling#7551 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
kedf_manager_ is allocated with scalar `new KEDF_Manager()`, but the reinitialization path in before_all_runners() freed it with `delete[]`, which is undefined behavior. Use scalar `delete` to match the allocation. Closes deepmodeling#7548 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
I fully disagree with the fix regarding #7568 and #7572; the reason, also what the real problem should lie in, has already been described simply under those issues.
|
Okay, I will further investigate about both issues and this PR. This is only a draft now. |
|
I'm having a deeper look about CMake cleanup these days, and the revision about |
As you are trying to fix the thing about FindMKL.cmake, I will remove the commits about this file in my PR. |
|
@Critsium-xy hi, because there are also commits to push from @QuantumMisaka side, I suggest pick the fix related with abacuslite out from this PR, in case of time consuming conflict-solving. |
LD_LIBRARY_PATH, PKG_CONFIG_PATH and CPATH referenced the misspelled SUPERLU32_DIST_ROOT while CMAKE_PREFIX_PATH used SUPERLU_DIST32_ROOT (the name defined in Dockerfile.intel). Align the path exports to SUPERLU_DIST32_ROOT so SuperLU_DIST is not silently omitted. Closes deepmodeling#7572 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dc1f11a to
1c0d273
Compare
Ok I will quickly do that. |
The Multiwfn and pyabacus STRU parsers checked for a LATTICE_PARAMETER block but then read blocks['LATTICE_PARAMETERS'] with an extra S, and treated the list of lines as a string. Read blocks['LATTICE_PARAMETER'][0].split() to match the neighboring LATTICE_CONSTANT idiom, so STRU files using LATTICE_PARAMETER parse instead of raising KeyError. The identical fix for the ASE AbacusLite parser is intentionally left out of this PR and will be handled separately. Refs deepmodeling#7555 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1c0d273 to
db5774d
Compare
This PR fixes a batch of low-risk, localized issues reported by the recent Codex global repository scan (the "[Code scan]" issues). Each fix is a separate commit referencing its issue.
Fixes
fdir suffix + s_dir→fdir + s_dir) in the RT-TDDFT projection toolelsebranch (add:no-op) ingenerate_orbital_mixstru.shsobash -npassesTwoCenterTable::is_present(l <=→l <)size[2], notsize[1]) when slicing 3D tensorsKEDF_Managerwith scalardeleteto match its allocationSUPERLU_DIST32_ROOTvariable in CI path exportsLATTICE_PARAMETERblocks consistently in the Multiwfn and pyabacus STRU parsers (partial)Verification
python -m py_compile.bash -n.